
clear

cd "replication files/Pooled analysis/"


use US_data_clean_w1_headline.dta, clear

/*US tips main effect*/
reg accuracy tips i.dv if fake==1, robust cluster(caseid)
estimates store usfake1, title(Tips effect on fake news accuracy w1)

reg accuracy tips i.dv if real==1, robust cluster(caseid)
estimates store usreal1, title(Tips effect on real news accuracy w1)

use US_respondent.dta, clear
reg mean_acc_diff tips, robust 
estimates store usdiff1, title(Tips effect on fake-real w1)

**india online
use india-online-respondentlevel.dta, clear
reg mean_acc_diff tips, robust 
est store india_online_w1_diff

use india-online-w1-headlinelevel.dta, clear
reg accuracy tips i.dv if fake==1, robust cluster(caseid) 
est store india_online_w1_false
reg accuracy tips i.dv if real==1, robust cluster(caseid) 
est store india_online_w1_true

**India f2f
use india-ftf-respondentlevel.dta, clear
reg mean_acc_diff tips, robust 
est store india_ftf_w1_diff

use india-ftf-w1-headlinelevel.dta, clear
reg accuracy tips i.dv if fake==1, robust cluster(caseid) 
est store india_ftf_w1_false
reg accuracy tips i.dv if real==1, robust cluster(caseid) 
est store india_ftf_w1_true

**w1 combo estimates
use US_data_clean_w1_headline.dta, clear
append using "india-online-w1-headlinelevel.dta", generate(onlinew1)

**add fixed effects
gen US_sample = consent
tab US_sample
recode US_sample 1=1 else=0
tab US_sample

reg accuracy tips US_sample   i.dv if fake==1, robust cluster(caseid) 
est store combo_onlinefake1
reg accuracy tips   i.dv if real==1, robust cluster(caseid) 
est store combo_onlinereal1

append using "india-ftf-w1-headlinelevel.dta",  generate(ftfw1)

tab ftfw1 
recode ftfw1 1=1 else=0

gen indiaonline = US_sample 
recode indiaonline 0=1 else=0
tab indiaonline 
tab ftfw1
tab US_sample
recode US_sample 1=1 else=0

gen ftf2 = ftfw1
recode ftf2 1=2 else=0

**sample 1= US 2= ftf 0 = online
gen sample_1 = US_sample + ftf2

egen newdv = group(dv sample_1)

reg accuracy tips  i.newdv if fake==1, robust cluster(caseid) 
est store combo_allfake1
reg accuracy tips  i.newdv if real==1, robust cluster(caseid) 
est store combo_allreal1

bysort onlinew1: reg accuracy tips i.dv if fake==1, robust cluster(caseid) 
bysort ftfw1: reg accuracy tips i.dv if fake==1, robust cluster(caseid) 

reg accuracy tips   i.dv if fake==1, robust cluster(caseid) 

use US_respondent.dta, clear
append using "india-online-respondentlevel.dta", generate (onlineresp)

gen Indiaonline = onlineresp
recode Indiaonline .=0

gen US_sample = consent
recode US_sample .=0

reg mean_acc_diff tips  , robust 
est store combo_onlinediff1

append using "india-ftf-respondentlevel.dta" , generate (ftfresp)

gen Indiaf2f = onlineresp 
recode Indiaf2f 1=0 .=1 
tab US_sample
tab Indiaonline
tab Indiaf2f

gen survey_sample = US_sample
recode US_sample .=2 0=3 1=1

gen consent1 = consent
recode consent1 .=0
gen US=consent1
tab US

gen ftf3 = Indiaf2f
recode ftf3 1=2 else=0

**sample 1= US 2= ftf 0 = online
gen sample_2 = US + ftf3

reg mean_acc_diff tips i.sample_2, robust 
est store combo_alldiff1

bysort onlineresp: reg mean_acc_diff tips, robust
bysort ftfresp: reg mean_acc_diff tips, robust
	   
**Table F1: Pooled estimates**
estout combo_allfake1 combo_allreal1 combo_alldiff1 using "pooled_est.tex", replace varwidth(25) collabels("") cells(b(star fmt(%9.4f)) se(par fmt(%9.4f))) stats(r2 N, fmt(%9.2f %9.0f) labels("R^2" "N")) starlevels(* 0.05 ** 0.01 *** 0.005) style(tex) 

**Figure 3: Pooled estimates**
local endash = ustrunescape("\u2013")

coefplot usfake1 india_online_w1_false india_ftf_w1_false combo_allfake1, bylabel (False news) subtitle(, size(small)) || ///
usreal1 india_online_w1_true india_ftf_w1_true  combo_allreal1, bylabel (Mainstream news) || ///
usdiff1  india_online_w1_diff   india_ftf_w1_diff combo_alldiff1, bylabel (Mainstream `endash' false)  ///
       ||, keep (tips) xline(0)  xsc(r(-.25 .25))  ylabel( "", nogrid angle(horizontal) ) ytick(, notick tlstyle(none) grid ) ///
  legend(row(2) size(vsmall) pos(6)  label(2 `"US"') label(4 `"India online"') label(6 `"India face-to-face"') label(8 `"Combined"') all order(2 4 6 8)) aspectratio(.5)  byopts(cols(1)) ///
graphregion(fcolor(white)   ifcolor(none)) plotregion(fcolor(none) lcolor(black) ifcolor(none) ilcolor(none)) ytitle("") scheme(lean1) ///
name(sub_comby, replace) 
graph export "sub_comby.pdf", replace









